import ReactDOM from 'react-dom'
import { Component } from 'react'
// 类组件定义状态
class App extends Component {
  state = {
    title: '数码产品',
    list: ['手机', '电脑', '相机']
  }
  render() {
    return (
      <div>
        <h3>{this.state.title}</h3>
        <ul>
          {this.state.list.map((item) => {
            return <li key={item}>{item}</li>
          })}
        </ul>
      </div>
    )
  }
}

ReactDOM.render(<App />, document.getElementById('root'))
